<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
  <head>
    <title>XMY-系统登陆</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <script type="text/javascript" src="static/jquery.min.js"></script>
      <script type="text/javascript" src="static/jquery.easyui.min.js"></script>
      <script type="text/javascript" src="static/locale/easyui-lang-zh_CN.js"></script>
      <script type="text/javascript" src="static/js/system/login.js?v=2015"></script>
      
      <link rel="stylesheet" type="text/css" href="static/themes/default/easyui.css">
      <link rel="stylesheet" type="text/css" href="static/themes/icon.css"> 
      <script type="text/javascript">
      </script>
  </head>
  <script type="text/javascript">

    $(function(){
      $("#dialog").dialog({
        closable:false,
        buttons:[{
          text:'登录',
          iconCls:'icon-save',
          handler:function(){
            fromsubmit();
          }
        },{
          text:'重置',
          iconCls:'icon-cancel',
          handler:function(){
            $("#form").from("reset");
          }
        }]
      });
    });
    function fromsubmit(){
      $("#form").form('submit',{
        url:'/checklogin?isajax=1',
        onSubmit:function(){
          return $("#form").form('validate');
        },
        success:function(r){
          var r = $.parseJSON( r );

          if(r.status){
            location.href = "/main"
          }else{
            alert(r.info);
          }
        }
      });
    }
    //这个就是键盘触发的函数
    var SubmitOrHidden = function(evt){
      evt = window.event || evt;
      if(evt.keyCode==13){
        //如果取到的键值是回车
        fromsubmit();
      }

    }
    window.document.onkeydown=SubmitOrHidden;//当有键按下时执行函数
  </script>


  <body>
  <div style="text-align:center;margin:0 auto;width:350px;height:250px;" id="dialog" title="登录">
    <div style="padding:20px 20px 20px 40px;" >
      <form id="form" method="post">
        <table >
          <tr>
            <td>用户名：</td><td><input type="text" class="easyui-validatebox" required="true" name="username" missingMessage="请输入用户名"/></td>
          </tr>
          <tr>
            <td>密码：</td><td><input type="password" class="easyui-validatebox" required="true" name="password" missingMessage="请输入密码"/></td>
          </tr>
        </table>
      </form>
    </div>
  </div>
  </body>




  <!--<body>-->
  	<!--<div style="width:220px; height:300px; margin:-103px 0px 0px 140px; position:absolute; top:50%; left:50%;">-->
        <!--<form id="loginInputForm" action="/main" method="post">-->
			<!--<table>-->
				<!--<tr>-->
					<!--<th>用户名</th>-->
					<!--<td><input type="text" name="username" id="username" value="" /></td>-->
				<!--</tr>-->
				<!--<tr>-->
					<!--<th>密码</th>-->
					<!--<td><input type="password" name="password" id="password" value="" /></td>-->
				<!--</tr>-->
			<!--</table>-->
			<!--<div style="margin-left: 55px;">-->
                <!--<input type="button" class="easyui-linkbutton" id="login" value="登陆" onclick="Login.login();" >-->
                <!--<input type="button" class="easyui-linkbutton" id="clear" value="重置" onclick="Login.clear();">-->
			<!--</div>-->
		<!--</form>-->
	<!--</div>-->
	<!-- -->
  <!--</body>-->
</html>
